import httpUtil from "../utils/httpUtil"
import logApi from "./logApi"

const submitOrder = (params, successHandler, errHandler) => {
	logApi.addKeepLog('提交订单之前，请求参数' + JSON.stringify(params))
	httpUtil.post("/api/keep/createOrder", params, res => {
		logApi.addKeepLog('提交订单之后，请求参数' + JSON.stringify(params) + '。返回：' + JSON.stringify(res))

		if (successHandler) {
			successHandler(res)
		}
	}, err => {
		if (errHandler) {
			errHandler(res)
		}
	})
}

export default {
	submitOrder,
}